<template>
  <div class="search">
    <f-drawer ref="bmpplanBaseDrawer" :title="drawerTitle" width="90%" @submit="handleSubmit" @visibleChange="visibleChange" :showFooter="false">
      <a-tabs @tabClick="tabClick" :defaultActiveKey="currentArray[0]" v-model="current">
        <a-tab-pane tab="材料明细" key="list01">
           <bmp-base-list01 ref="list01" v-if="drawerVisible" :projectId="projectId"></bmp-base-list01>
        </a-tab-pane>
        <a-tab-pane tab="版本操作履历" key="list02">
          <bmp-base-list02 ref="list02" v-if="drawerVisible"></bmp-base-list02>
        </a-tab-pane>
        <a-tab-pane tab="版本审批履历" key="list03">
          <bmp-base-list03 ref="list03" v-if="drawerVisible"></bmp-base-list03>
        </a-tab-pane>
      </a-tabs>
    </f-drawer>
  </div>
</template>
<script>
  import bmpBaseList01 from './bmp_base_list_01.vue'
  import bmpBaseList02 from './bmp_base_list_02.vue'
  import bmpBaseList03 from './bmp_base_list_03.vue'
  export default {
    name: 'bmpplanBaseDrawer',
    components: { bmpBaseList01, bmpBaseList02, bmpBaseList03 },
    props: {},
    data() {
      return {
        footerStatus: false,
        refs:this.$refs,
        drawerVisible: false,
        title: '基础信息',
        currentArray: ['list01', 'list02', 'list03'],
        current: '',
        queryParam: {}
      }
    },
    methods: {
      showDrawer(data) {
        this.projectId = data.projectIds
        if (data && data.materialPlan100Id) {
          this.queryParam = data
        } else {
          this.queryParam = {}
        }
        this.refs['bmpplanBaseDrawer'].show()
        this.tabClick(this.currentArray[0])
      },
      handleSubmit(callback) {
      },
      visibleChange(drawerVisible) {
        this.drawerVisible = drawerVisible
      },
      tabClick(name) {
        this.current = name
      }
    },
    computed: {
      drawerTitle: function() {
        return this.title
      }
    },
    created() {
    }
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
